package com.eryos.android.cigarettecounter.beans;

/**
 * Project :  CigaretteCounter
 * Author :   Olivier Combe 
 * URL :      http://eryos.fr/CigaretteCounter/
 *
 * Copyright (C) 2011 - Olivier Combe 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 *
 */

import java.io.Serializable;

public class History implements Serializable {

	static final long serialVersionUID = 7717637493458101747L;

	public enum Type {WEEKLY, MONTHLY}
	
	private Type type;
	
	public History(){
		
	}
	
	public History(Type _type){
		type = _type;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}
	
	public boolean isMonthly(){
		if ( type == Type.MONTHLY)
			return true;
		else
			return false;
	}
	
	public boolean isWeekly(){
		if ( type == Type.WEEKLY)
			return true;
		else
			return false;
		
	}
	
	public String toString(){
		switch(type){
		case WEEKLY:
			return "Weekly";
		case MONTHLY:
			return "Monthly";
			default :
				return "Unknown";
		}
	}
}
